home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 248_01 / dstruct.h < prev    next >
Text File  |  1989-08-16  |  2KB  |  68 lines

  1. /*    DSTRUCT:    Structure and preprocesser defined for MicroSPELL 1.0
  2.             Spell Checker and Corrector
  3.  
  4.             (C)opyright May 1987 by Daniel Lawrence
  5.             All Rights Reserved
  6. */
  7.  
  8. #if    V7 | USG | BSD
  9. #define    PATHCHR    ':'
  10. #else
  11. #define    PATHCHR    ';'
  12. #endif
  13.  
  14. #define    INTWIDTH    sizeof(int) * 3
  15.  
  16. /* DIFCASE represents the integer difference between upper
  17.    and lower case letters.  It is an xor-able value, which is
  18.    fortunate, since the relative positions of upper to lower
  19.    case letters is the opposite of ascii in ebcdic.
  20. */
  21.  
  22. #ifdef    islower
  23. #undef    islower
  24. #endif
  25.  
  26. #ifdef    isupper
  27. #undef    isupper
  28. #endif
  29.  
  30. #if    ASCII
  31.  
  32. #define    DIFCASE        0x20
  33. #define SEPCHAR         '^'
  34. #define isletter(c)    (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z'))
  35. #define islower(c)    ('a' <= c && c <= 'z')
  36. #define isupper(c)    ('A' <= c && c <= 'Z')
  37. #endif
  38.  
  39. #if    EBCDIC
  40.  
  41. #define    DIFCASE        0x40
  42. #define SEPCHAR         '{'
  43. #define isletter(c)    (('a' <= c && 'i' >= c) || ('j' <= c && 'r' >= c) || ('s' <= c && 'z' >= c) || ('A' <= c && 'I' >= c) || ('J' <= c && 'R' >= c) || ('S' <= c && 'Z' >= c))
  44. #define islower(c)    (('a' <= c && 'i' >= c) || ('j' <= c && 'r' >= c) || ('s' <= c && 'z' >= c))
  45. #define isupper(c)    (('A' <= c && 'I' >= c) || ('J' <= c && 'R' >= c) || ('S' <= c && 'Z' >= c))
  46. #endif
  47.  
  48. /*    Dynamic RAM tracking and reporting redefinitions    */
  49.  
  50. #if    RAMSIZE
  51. #define    malloc    allocate
  52. #define    free    release
  53. #endif
  54.  
  55. /*
  56.     The input document is read in and broken up into words. The
  57.     place each word came from in the origional document is stored
  58.     along with the word.  The following structure is used to store
  59.     these words.
  60. */
  61.  
  62. typedef    struct    WORD {
  63.     int w_file;        /* source file of word */
  64.     int w_line;        /* line of word */
  65.     int w_col;        /* column of word */
  66.     char w_text[1];        /* text of current word */
  67. } WORD;
  68.